package StudyCode.summary.myfile;

import java.io.IOException;
import java.nio.file.*;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class NIOCustomFilter {
	public static void main(String[] args) {

		Path path = Paths.get("E:\\CODE\\JAVA\\ReviewCode\\src\\StudyCode\\");

		DirectoryStream.Filter<Path> dir_filter = new DirectoryStream.Filter<Path>() {

			@Override
			public boolean accept(Path path) {
				return (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS));
			}
		};

		try (DirectoryStream<Path> ds = Files.newDirectoryStream(path, dir_filter)) {
			for (Path file : ds) {
				System.out.println(file.getFileName());
			}
		} catch (IOException e) {
			System.err.println(e);
		}
	}
}
